{
 "cells": [
  {
   "cell_type": "code",
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2025-05-20T02:49:38.760720Z",
     "start_time": "2025-05-20T02:49:37.142996Z"
    }
   },
   "source": [
    "import torch\n",
    "from scipy.stats import norm"
   ],
   "outputs": [],
   "execution_count": 1
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-20T02:49:38.879636Z",
     "start_time": "2025-05-20T02:49:38.873612Z"
    }
   },
   "cell_type": "code",
   "source": [
    "offset = 0.9677083\n",
    "tmp = torch.linspace(offset, 0.5, 9)\n",
    "tmp"
   ],
   "id": "bdf40a181479e3c4",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([0.9677, 0.9092, 0.8508, 0.7923, 0.7339, 0.6754, 0.6169, 0.5585, 0.5000])"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 2
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-20T02:49:38.891375Z",
     "start_time": "2025-05-20T02:49:38.888064Z"
    }
   },
   "cell_type": "code",
   "source": [
    "tmp = tmp[:-1]\n",
    "tmp"
   ],
   "id": "286dd27e3fb3d9bc",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([0.9677, 0.9092, 0.8508, 0.7923, 0.7339, 0.6754, 0.6169, 0.5585])"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 3
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-20T02:49:38.912744Z",
     "start_time": "2025-05-20T02:49:38.908741Z"
    }
   },
   "cell_type": "code",
   "source": [
    "v1 = norm.ppf(tmp).tolist()\n",
    "v1"
   ],
   "id": "e901a62a82a2c888",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1.8481308221817017,\n",
       " 1.3361188173294067,\n",
       " 1.0397897958755493,\n",
       " 0.8144894242286682,\n",
       " 0.6245115995407104,\n",
       " 0.4548477232456207,\n",
       " 0.29742005467414856,\n",
       " 0.14707480370998383]"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 4
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-20T02:49:38.943028Z",
     "start_time": "2025-05-20T02:49:38.940754Z"
    }
   },
   "cell_type": "code",
   "source": "v2 = [0]",
   "id": "d2642702b48f3392",
   "outputs": [],
   "execution_count": 5
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-20T02:49:38.972172Z",
     "start_time": "2025-05-20T02:49:38.968168Z"
    }
   },
   "cell_type": "code",
   "source": [
    "v3 = (-norm.ppf(torch.linspace(offset, 0.5, 8)[:-1])).tolist()\n",
    "v3"
   ],
   "id": "300ea598e86451aa",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[-1.8481308221817017,\n",
       " -1.2866554260253906,\n",
       " -0.9704037308692932,\n",
       " -0.7298591732978821,\n",
       " -0.5256848931312561,\n",
       " -0.34148547053337097,\n",
       " -0.16827237606048584]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 6
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-20T02:49:38.991492Z",
     "start_time": "2025-05-20T02:49:38.988386Z"
    }
   },
   "cell_type": "code",
   "source": [
    "v= v1 + v2 + v3\n",
    "v"
   ],
   "id": "3625abe580d53b29",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1.8481308221817017,\n",
       " 1.3361188173294067,\n",
       " 1.0397897958755493,\n",
       " 0.8144894242286682,\n",
       " 0.6245115995407104,\n",
       " 0.4548477232456207,\n",
       " 0.29742005467414856,\n",
       " 0.14707480370998383,\n",
       " 0,\n",
       " -1.8481308221817017,\n",
       " -1.2866554260253906,\n",
       " -0.9704037308692932,\n",
       " -0.7298591732978821,\n",
       " -0.5256848931312561,\n",
       " -0.34148547053337097,\n",
       " -0.16827237606048584]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 7
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-20T02:51:42.140692Z",
     "start_time": "2025-05-20T02:51:42.133691Z"
    }
   },
   "cell_type": "code",
   "source": [
    "val = torch.tensor(v, dtype=torch.float64)\n",
    "val = val.sort().values\n",
    "val /= val.max()\n",
    "val"
   ],
   "id": "ef2b6a1592e9e5f1",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([-1.0000, -0.6962, -0.5251, -0.3949, -0.2844, -0.1848, -0.0911,  0.0000,\n",
       "         0.0796,  0.1609,  0.2461,  0.3379,  0.4407,  0.5626,  0.7230,  1.0000],\n",
       "       dtype=torch.float64)"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 12
  },
  {
   "metadata": {},
   "cell_type": "code",
   "outputs": [],
   "execution_count": null,
   "source": "",
   "id": "de05fd6c736731b7"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
